#!/usr/bin/env python

# from tempfile import mkstemp
# from shutil import move
from os import remove, close
import re
import sys
 
def changeAndroidStrings_ToXcodeStrings(filename):
    #Create temp file
    # fh, abs_path = mkstemp()
    new_filename = filename + "1"
    new_file = open(new_filename,'w')
    print abs_path
    old_file = open(filename)
    
    
    
    for line in old_file:
        match = re.search(r'\"(.*)\"(.*)>(.*)<',line,re.M|re.I)
        if match:
            s = "\"" + match.group(1) + "\"" + "=" + "\"" + match.group(3) + "\"" + "\n"
            new_file.write(s)



    new_file.close()
    close(fh)
    old_file.close()
    
     
def main():
    if len(sys.argv) != 2:
        print ('%(prog)s filename ')
        exit()
 
    changeAndroidStrings_ToXcodeStrings(sys.argv[1])
 
if __name__=="__main__":
    """If the this file  run as program then execute the main method"""
    main()
